package org.geektimes.projects.user.management;

import org.eclipse.microprofile.config.ConfigProvider;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @Author: menglinggang
 * @Date: 2021-03-16
 * @Time: 10:12 下午
 */
public class ObjectShow implements ObjectShowMBean{

    private TargetObject targetObject;

    public ObjectShow(TargetObject targetObject) {
        this.targetObject = targetObject;
    }

    public ObjectShow() {
    }

    @Override
    public String getName() {
        return targetObject.getName();
    }

    @Override
    public void setName(String name) {
        targetObject.setName(name);
    }

    @Override
    public int getType() {
        return targetObject.getType();
    }

    @Override
    public void setType(int type) {
        targetObject.setType(type);
    }

    @Override
    public void doSomeThing(String arg) {
        String value = ConfigProvider.getConfig().getValue("application.name", String.class);

        System.out.println(targetObject.toString() + value);
    }

    @Override
    public String toString() {
        return targetObject.toString();
    }
}
